package com.jk.controller;

import com.jk.bean.Staff;
import com.jk.bean.User;
import com.jk.service.LoginService;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;

@Controller
@RequestMapping("login")
public class LoginController {

    @Resource
    private LoginService loginService;

    @ResponseBody
    @RequestMapping("loginStaff")
    public Staff loginStaff(@RequestBody  Staff stall){

        return loginService.loginStaff(stall);
    }

    @ResponseBody
    @RequestMapping("userLogin")
    public User userLogin(@RequestBody User user){
        User user1 = loginService.userLogin(user);
        return user1;
    }

}
